let tab = document.querySelector(".tab");
let tabs = tab.children;
let tabBodys = document.querySelector(".tab-body").children;
let current = 0;
[...tabs].forEach((item, index) => {
    item.onclick = () => {
        tab.classList.remove(`tab-${current+1}`);
        tabBodys[current].hidden = true;
        tab.classList.add(`tab-${index+1}`);
        tabBodys[index].hidden = false;
        current = index;
    }
});